package Music_View;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.Frame;
import java.awt.Image;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.io.IOException;

import javax.swing.BoxLayout;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JPanel;
import javax.swing.JProgressBar;
import javax.swing.JRootPane;
import javax.swing.JScrollPane;
import javax.swing.JSlider;
import javax.swing.JTable;
import javax.swing.JTextPane;
import javax.swing.ListSelectionModel;
import javax.swing.border.EmptyBorder;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.table.TableCellRenderer;

import Music_Main.music_main;
import model.Model;

public class music_view extends JFrame{
	boolean IS=true;
	public static boolean Isplay=true;
	boolean voice=true;
	boolean Loop=true;
	float temp = 100;
	static JComboBox jBox;
	JPanel contentPane;
	JLabel background;
	JPanel meunPanel;
	JPanel meunPanel1;
	JPanel openfile;
	JPanel controlButtPanel;
	JPanel controlbasePanel;
	JPanel progresspanel;
	JPanel assScPanel;
	JPanel voicepanel;
	JPanel playerlist1;
	JPanel playerlist2;
	JPanel listpanel;
	JPanel songname;
	JPanel upsongpan;
	JPanel SongName;
	JPanel Songtext;
	JPanel Songtextup;
	JPanel Songtextdown;
	JPanel Songtextmidu;
	JPanel Songtextup1;
	JPanel Songtextup2;
	JPanel Songtextup3;
	JPanel Songtextdown1;
	JPanel Songtextdown2;
	JPanel Songtextdown3;
	JPanel Songpanl;
	JLabel Exit;
	JLabel hidden;
	JLabel bigorsmall;
	static JLabel currtimepanel;
	JLabel close;
	static JLabel upsongshow;
	JLabel voicelabel;
	static JLabel totaltimepanel;
	JLabel voiceaccout1label;
	JLabel voiceaccout2label;
	static JLabel songN;
	Icon imgu,img,img_d;
	JRootPane rootPane;
	JMenuBar jb;
	JMenu jm;
	JButton beforeButt;
	static JButton playOrPause;
	JButton nextButt;
	JButton  empty = new JButton(); //空白;
	JButton loop;
	JButton delet;
	JButton clear;
	JMenuItem fm,dm;
	JScrollPane listjs;
	BoxLayout boxLayout;
	static JLabel textLyric0;
	static JLabel textLyric1;
	static JLabel textLyric2;
	static JLabel textLyric3;
	static JLabel textLyric4;
	static JLabel textLyric5;
	static JLabel textLyric6;
	static JProgressBar progress;
    public static  JSlider slider;        //声音控制块
	private  Model model;
	private JSlider jslist;
	public static JTable table; 
	public music_view(){
	setTitle("播放器");//软件名
	setBounds(160,100,1000,650);	//设置窗口大小		
	//设置背景图片
	  ReSizeEvent dg = new ReSizeEvent(this);        /**添加两个监听器**/        
		  this.addMouseListener(dg);        
		  this.addMouseMotionListener(dg);     
    	  Toolkit tool=this.getToolkit();
       	  Image im=tool.getImage(Frame.class.getResource("/images/myplayer.png"));
       	  this.setIconImage(im);
			 contentPane=new JPanel();
			 setContentPane(contentPane);
			 contentPane.setLayout(new BorderLayout(0, 0));
			 contentPane.setBackground(null);
			 contentPane.setOpaque(false);
				//菜单栏
	          meunPanel = new JPanel();
	          meunPanel.setBackground(new Color(51,51,204)); // 设置窗体背景颜色
	          contentPane.add(meunPanel,BorderLayout.NORTH);
	          meunPanel.setPreferredSize(new Dimension(50, 50));//关键代码,设置JPanel的大小 
	          meunPanel.setBorder(new EmptyBorder(0, 5, 0, 0));
	          meunPanel.setLayout(new BorderLayout(10, 10));
	          JLabel headicon = new JLabel();
	          headicon.setBackground(null);
	          headicon.setOpaque(false);
	          meunPanel.add(headicon,BorderLayout.WEST);
	          headicon.setIcon(new ImageIcon(music_view.class.getResource("/images/myplayer.png")));
	          upsongpan = new JPanel();
	          meunPanel.add(upsongpan,BorderLayout.CENTER);
	          upsongpan.setBackground(null);
	          upsongpan.setOpaque(false);
	          upsongpan.setLayout(new FlowLayout(FlowLayout.CENTER));
	          upsongshow = new JLabel("");
	          upsongpan.add(upsongshow);
	          upsongshow.setForeground(Color.red);
	          upsongshow.setFont(new java.awt.Font("微软雅黑", 1, 25));
	          meunPanel1 = new JPanel();
	          meunPanel1.setBackground(null);
	          meunPanel1.setOpaque(false);
	          meunPanel.add(meunPanel1,BorderLayout.EAST);
	          meunPanel1.setBackground(new Color(80, 80, 80));
	          meunPanel1.setLayout(new FlowLayout(FlowLayout.RIGHT, 10, 10));
	          jb=new JMenuBar();
	          jb.setBackground(null);
	          jb.setOpaque(false);
	  		  jm=new JMenu("打开");
	  		  jm.setToolTipText("打开");
	  		  jm.setForeground(Color.WHITE);
	  		  jm.setFont(new java.awt.Font("微软雅黑", 1, 15));
	  		  jm.addMouseListener(new MouseAdapter(){
		          public void mouseEntered(MouseEvent e) {
		        	  jm.setForeground(Color.red);
		        } public void mouseExited(MouseEvent e) {
		        	 jm.setForeground(Color.WHITE);
		        }});
	  		  fm=new JMenuItem("文件");
	  		  fm.addActionListener(new ActionListener() {
		  			@Override
					public void actionPerformed(ActionEvent e){   	
			            	  music_main.openmusic();                
			          }});
	  		  dm=new JMenuItem("文件夹");
	  		  dm.addActionListener(new ActionListener() {
	  			@Override
				public void actionPerformed(ActionEvent e){    
		            	  music_main.openmusicpath();                
		          }});
	  		  jb.add(jm);
	  		  jm.add(fm);
	  		  jm.add(dm);
	          rootPane=new JRootPane();
	          rootPane.setBackground(null);
	          rootPane.setOpaque(false);
	          rootPane.setJMenuBar(jb);
	          openfile = new JPanel();
	          openfile.setBackground(null);
	          openfile.setOpaque(false);
	          openfile.add(rootPane);
	          meunPanel1.add(openfile);
	          Exit = new JLabel("退出");
	          meunPanel1.add(Exit);
	          Exit.setToolTipText("退出");
	          Exit.setFont(new java.awt.Font("微软雅黑", Font.BOLD, 15));
	          Exit.setForeground(Color.WHITE);
	          Exit.addMouseListener(new MouseAdapter(){
			         public void mouseClicked(MouseEvent e) {    
			              if (e.getClickCount()==1) {  
			            	  try {
								music_main.exit();
							} catch (IOException e1) {
								// TODO 自动生成的 catch 块
								e1.printStackTrace();
							}
			           }                
			          }public void mouseEntered(MouseEvent e) {
			        	  Exit.setForeground(Color.red);
			        } public void mouseExited(MouseEvent e) {
			        	 Exit.setForeground(Color.WHITE);
			        }});
	          hidden = new JLabel("");
	          meunPanel1.add(hidden);
	          hidden.setToolTipText("最小化");
	          hidden.setIcon(new ImageIcon(music_view.class.getResource("/images/hidden.png")));
	          hidden.addMouseListener(new MouseAdapter(){
			         public void mouseClicked(MouseEvent e) {    
			              if (e.getClickCount()==1) {  	
			            	  music_main.MinWindow();
			           }                
			          }public void mouseEntered(MouseEvent e) {
			        	  hidden.setIcon(new ImageIcon(music_view.class.getResource("/images/selecthidden.png")));
			        } public void mouseExited(MouseEvent e) {
			        	 hidden.setIcon(new ImageIcon(music_view.class.getResource("/images/hidden.png")));
			        }});
	          
	        //功能不完善
//	          bigorsmall = new JLabel("");
//	          meunPanel1.add(bigorsmall);
//	          bigorsmall.setToolTipText("最大化");
//	          bigorsmall.setIcon(new ImageIcon(music_view.class.getResource("/images/changebig.png")));
//	          bigorsmall.addMouseListener(new MouseAdapter(){
//			         public void mouseClicked(MouseEvent e) {    
//			        	 music_main.PanelFullScree(IS);
//			        	 if(IS) {
//			        		 img=new ImageIcon(Frame.class.getResource("/images/timg1.jpg"));
//			        		 imgu=new ImageIcon(Frame.class.getResource("/images/bottom1.png"));
//			        		 img_d=new ImageIcon(Frame.class.getResource("/images/bottom1.png"));    	
//			        	 }else {
//			        		 img=new ImageIcon(Frame.class.getResource("/images/timg11.jpg")); 
//			        		 imgu=new ImageIcon(Frame.class.getResource("/images/bottom.png"));  
//			        		 img_d=new ImageIcon(Frame.class.getResource("/images/bottom.png")); 
//			        	 }
//			              IS = !IS;
//			          }public void mouseEntered(MouseEvent e) {
//			        	  if(IS) {
//			        		  bigorsmall.setIcon(new ImageIcon(music_view.class.getResource("/images/selectbig.png")));
//			        	  }else {
//			        		  bigorsmall.setIcon(new ImageIcon(music_view.class.getResource("/images/selectsmall.png")));
//			        	  }
//			        } public void mouseExited(MouseEvent e) {
//			        	if(IS) {
//			        		bigorsmall.setIcon(new ImageIcon(music_view.class.getResource("/images/changebig.png")));
//			        	}else {
//			        		bigorsmall.setIcon(new ImageIcon(music_view.class.getResource("/images/changesmall.png")));
//			        	}
//			        }});
	          close = new JLabel("");
	          meunPanel1.add(close);
	          close.setToolTipText("关闭");
	          close.setIcon(new ImageIcon(music_view.class.getResource("/images/close.png")));
	          close.addMouseListener(new MouseAdapter(){
		         public void mouseClicked(MouseEvent e) {    
		              if (e.getClickCount()==1) {  	
		            	  try {
							music_main .exit();
						} catch (IOException e1) {
							// TODO 自动生成的 catch 块
							e1.printStackTrace();
						}
		           }                
		          }public void mouseEntered(MouseEvent e) {
		          close.setIcon(new ImageIcon(music_view.class.getResource("/images/selectclose.png")));
		        } public void mouseExited(MouseEvent e) {
		        	close.setIcon(new ImageIcon(music_view.class.getResource("/images/close.png")));
		        }});
	          
	          
	          
	          //播放列表面板
	          listpanel = new JPanel();
	          contentPane.add(listpanel,BorderLayout.WEST);
	          listpanel.setLayout(new BorderLayout(0,0));
	          playerlist1 = new JPanel();
	          listpanel.add(playerlist1,BorderLayout.SOUTH);
	         // playerlist1.setPreferredSize(new Dimension(80,80));
	          playerlist1.setLayout(new BorderLayout(10,10));
	          playerlist1.setBorder(new EmptyBorder(5, 5, 5, 5));
	          delet = new JButton("删除");
	          playerlist1.add(delet,BorderLayout.WEST);
	          delet.setFocusPainted(false);
	          delet.setBorderPainted(false);
	          delet.setContentAreaFilled(false);
	          delet.setToolTipText("删除");
	          delet.addMouseListener(new MouseAdapter(){
			         public void mouseClicked(MouseEvent e) {    
			              if (e.getClickCount()==1) {  
			            	  music_main.Delet();
			           }                
			          }public void mouseEntered(MouseEvent e) {
			        	  delet.setForeground(Color.red);
			        } public void mouseExited(MouseEvent e) {
			        	delet.setForeground(Color.black);
			        }});
	          clear = new JButton("清空");
	          playerlist1.add(clear,BorderLayout.EAST);
	          clear.setFocusPainted(false);
	          clear.setBorderPainted(false);
	          clear.setContentAreaFilled(false);
	          clear.setToolTipText("清空");
	          clear.addMouseListener(new MouseAdapter(){
			         public void mouseClicked(MouseEvent e) {    
			              if (e.getClickCount()==1) {  
			            	  music_main.Clear();
			           }                
			          }public void mouseEntered(MouseEvent e) {
			        	  clear.setForeground(Color.red);
			        } public void mouseExited(MouseEvent e) {
			        	clear.setForeground(Color.black);
			        }});
	          playerlist2 = new JPanel();
	          listpanel.add(playerlist2,BorderLayout.CENTER);
	          playerlist2.setPreferredSize(new Dimension(285,300));
	          playerlist2.setLayout(new BorderLayout(10,10));
	          //listpanel.setPreferredSize(new Dimension(320, 400));//关键代码,设置JPanel的大小 
	          listpanel.setBackground(null);
	          listpanel.setOpaque(false);
	          model=new Model();			//添加表
	      	  table=new JTable(model){ // 设置jtable的单元格为透明的
				   public Component prepareRenderer(TableCellRenderer renderer,int row, int column) {
						    Component c = super.prepareRenderer(renderer, row, column);
//						    if (c instanceof JComponent) {
//						     ((JComponent) c).setOpaque(false);
//						    }
						    return c;
						   }
						  };
						  
			table.setOpaque(false);
			table.setRowHeight(30);
			table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION );
			table.setShowHorizontalLines(false);
			table.addMouseListener(new MouseAdapter(){
		         public void mouseClicked(MouseEvent e) {    
		              if (e.getClickCount()==2) {  
		            	  music_main.ClickList();
		           }                
		         }});
			listjs = new JScrollPane(table);
			listjs.setOpaque(false);
			listjs.getViewport().setOpaque(false);
			playerlist2.add(listjs,BorderLayout.CENTER);
			
			//歌词面板
			Songpanl = new JPanel();
			contentPane.add(Songpanl,BorderLayout.CENTER);
			Songpanl.setLayout(new BorderLayout(10,10));
			SongName = new JPanel();
			Songpanl.add(SongName,BorderLayout.NORTH);
			SongName.setLayout(new FlowLayout(FlowLayout.CENTER,10,10));
			songN = new JLabel("当前无播放");
			SongName.add(songN);
			songN.setFont(new java.awt.Font("微软雅黑", Font.BOLD, 20));
			songN.setForeground(Color.GREEN);
			Songtext = new JPanel();
			Songtext.setBorder(new EmptyBorder(30, 10, 10, 10));
			Songpanl.add(Songtext,BorderLayout.CENTER);
			boxLayout = new BoxLayout(Songtext, BoxLayout.Y_AXIS);
			Songtext.setLayout(boxLayout);
			Songtext.setAlignmentX(CENTER_ALIGNMENT);
//			
//			Songtextup = new JPanel();
//			Songtext.add(Songtextup,BorderLayout.NORTH);
//			Songtextup.setLayout(new BorderLayout(10,10));
//			Songtextup1 = new JPanel();
//			Songtext.add(Songtextup1);
//			Songtextup1.setLayout(new FlowLayout(FlowLayout.CENTER,0,0));
			textLyric0 = new JLabel();
			textLyric0.setBorder(new EmptyBorder(20, 10, 10, 10));
			textLyric0.setAlignmentX(CENTER_ALIGNMENT);
			textLyric0.setText("");//歌词控件添加文字
			textLyric0.setForeground(Color.gray);//歌词控件字体颜色
			textLyric0.setFont(new java.awt.Font("楷体", Font.BOLD, 18));
			textLyric0.setOpaque(false);//歌词控件透明
			Songtext.add(textLyric0);
			
//			Songtextup2 = new JPanel();
//			Songtext.add(Songtextup2);
//			Songtextup2.setLayout(new FlowLayout(FlowLayout.CENTER,0,0));
			textLyric1 = new JLabel();
			textLyric1.setBorder(new EmptyBorder(20, 10, 10, 10));
			textLyric1.setAlignmentX(CENTER_ALIGNMENT);
			textLyric1.setText("");//歌词控件添加文字
			textLyric1.setForeground(new Color(142,182,205));//歌词控件字体颜色
			textLyric1.setFont(new java.awt.Font("楷体", Font.BOLD, 23));
			textLyric1.setOpaque(false);//歌词控件透明
			Songtext.add(textLyric1);
			
//			Songtextup3 = new JPanel();
//			Songtext.add(Songtextup3);
//			Songtextup3.setLayout(new FlowLayout(FlowLayout.CENTER,0,0));
			textLyric2 = new JLabel();
			textLyric2.setBorder(new EmptyBorder(20, 10, 10, 10));
			textLyric2.setAlignmentX(CENTER_ALIGNMENT);
			textLyric2.setText("");//歌词控件添加文字
			textLyric2.setForeground(new Color(126,192,238));//歌词控件字体颜色
			textLyric2.setFont(new java.awt.Font("楷体", Font.BOLD, 28));
			textLyric2.setOpaque(false);//歌词控件透明
			Songtext.add(textLyric2);
			
		
//			JPanel Songtextmidudown = new JPanel();
//			Songtext.add(Songtextmidudown,BorderLayout.CENTER);
//			Songtextmidudown.setLayout(new BorderLayout(10,10));
//			Songtextmidu = new JPanel();
//			Songtext.add(Songtextmidu);
////			Songtextmidu.setPreferredSize(new Dimension(20,20));
//			Songtextmidu.setLayout(new FlowLayout(FlowLayout.CENTER,0,0));
			textLyric3 = new JLabel();
			textLyric3.setBorder(new EmptyBorder(20, 10, 10, 10));
			textLyric3.setAlignmentX(CENTER_ALIGNMENT);
			textLyric3.setText("点击音乐列表，选择歌曲进行播放吧！ \n");//歌词控件添加文字
			textLyric3.setForeground(new Color(0, 0, 238));//歌词控件字体颜色
			textLyric3.setFont(new java.awt.Font("楷体", Font.BOLD, 32));
			textLyric3.setOpaque(false);//歌词控件透明
			Songtext.add(textLyric3);
			
			
			
//			Songtextdown = new JPanel();
//			Songtextmidudown.add(Songtextdown,BorderLayout.SOUTH);
//			Songtextdown.setLayout(new BorderLayout(10,10));
//			Songtextmidudown.setBorder(new EmptyBorder(0, 5, 100, 0));
//			Songtextdown1 = new JPanel();
//			Songtext.add(Songtextdown1);
//			Songtextdown1.setLayout(new FlowLayout(FlowLayout.CENTER,0,0));
			textLyric4 = new JLabel();
			textLyric4.setBorder(new EmptyBorder(20, 10, 10, 10));
			textLyric4.setAlignmentX(CENTER_ALIGNMENT);
			textLyric4.setText("");//歌词控件添加文字
			textLyric4.setForeground(new Color(48,118,255));//歌词控件字体颜色
			textLyric4.setFont(new java.awt.Font("楷体", Font.BOLD, 28));
			textLyric4.setOpaque(false);//歌词控件透明
			Songtext.add(textLyric4);
			
//			Songtextdown2 = new JPanel();
//			Songtext.add(Songtextdown2);
//			Songtextdown2.setLayout(new FlowLayout(FlowLayout.CENTER,0,0));
			textLyric5 = new JLabel();
			textLyric5.setBorder(new EmptyBorder(20, 10, 10, 10));
			textLyric5.setAlignmentX(CENTER_ALIGNMENT);
			textLyric5.setText("");//歌词控件添加文字
			textLyric5.setForeground(new Color(92,172,238));//歌词控件字体颜色
			textLyric5.setFont(new java.awt.Font("楷体", Font.BOLD, 23));
			textLyric5.setOpaque(false);//歌词控件透明
			Songtext.add(textLyric5);
			
//			Songtextdown3 = new JPanel();
//			Songtext.add(Songtextdown3);
//			Songtextdown3.setLayout(new FlowLayout(FlowLayout.CENTER,0,0));
			textLyric6 = new JLabel();
			textLyric6.setBorder(new EmptyBorder(20, 10, 10, 10));
			textLyric6.setAlignmentX(CENTER_ALIGNMENT);
			textLyric6.setText("");//歌词控件添加文字
			textLyric6.setForeground(new Color(113,113,198));//歌词控件字体颜色
			textLyric6.setFont(new java.awt.Font("楷体", Font.BOLD, 18));
			textLyric6.setOpaque(false);//歌词控件透明
			Songtext.add(textLyric6);
			
			
			//控制栏
			controlbasePanel = new JPanel();
			contentPane.add(controlbasePanel,BorderLayout.SOUTH);
			controlbasePanel.setLayout(new BorderLayout(10,10));
			controlbasePanel.setBackground(new Color(51,51,204));
			controlbasePanel.setPreferredSize(new Dimension(60, 60));//关键代码,设置JPanel的大小 
			controlButtPanel = new JPanel();
			controlbasePanel.add(controlButtPanel,BorderLayout.SOUTH);
			controlButtPanel.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5));
			controlButtPanel.setBackground(null);
			controlButtPanel.setOpaque(false);
			
			  assScPanel = new JPanel();
			  controlbasePanel.add(assScPanel,BorderLayout.NORTH);
	  		  assScPanel.setBackground(new Color(80, 80, 80)); // 设置窗体背景颜色
	  		  assScPanel.setLayout(new BorderLayout(0, 0));
	  		  assScPanel.setBackground(null);
	  		  assScPanel.setOpaque(false);
	  		  progresspanel = new JPanel();
	  		  assScPanel.add(progresspanel,BorderLayout.CENTER);
	  		  progresspanel.setBorder(new EmptyBorder(5, 5, 5, 5));
	  		  progresspanel.setLayout(new BorderLayout(10, 10));
	  		  progresspanel.setBackground(new Color(80, 80, 80)); 
	  		  progresspanel.setBackground(null);
	  		  progresspanel.setOpaque(false);
	  		  currtimepanel = new JLabel("00:00");
	  		  progresspanel.add(currtimepanel,BorderLayout.WEST);
	  		  currtimepanel.setBackground(null);
	  		  currtimepanel.setOpaque(false);
	  		  currtimepanel.setForeground(Color.WHITE);
	  		  // 视频播放进度条
	  		  progress = new JProgressBar();
	  		  progresspanel.add(progress,BorderLayout.CENTER);
	  		  progresspanel.setPreferredSize(new Dimension(23,23));//关键代码,设置JPanel的大小 
	  		  progress.setStringPainted(true);
//	  		  progress.addMouseListener(new MouseAdapter() {
//	  			@Override
//	  			public void mouseClicked(MouseEvent e) {
//	  				// 获得鼠标点击进度条时的横坐标x值
//	  			    int x = e.getX();
//	  				// x除以进度条总长度为当前百分比
//	  				music_main.jumpTo(((float) x / progress.getWidth()));
//	  			}
//	  		  });
	  		  totaltimepanel = new JLabel("00:00");
	  		  progresspanel.add(totaltimepanel,BorderLayout.EAST);
	  		  totaltimepanel.setForeground(Color.WHITE);
	  		  
			  beforeButt = new JButton("");
	  		  controlButtPanel.add(beforeButt);
	  		  beforeButt.setFocusPainted(false);
	  		  beforeButt.setBorderPainted(false);
	  		  beforeButt.setContentAreaFilled(false);
	  		  beforeButt.setIcon(new ImageIcon(music_view.class.getResource("/images/mediaBefore.png")));
	  		  beforeButt.setToolTipText("上一集");
	  		  beforeButt.addMouseListener(new MouseAdapter(){
			         public void mouseClicked(MouseEvent e) {    
			              if (e.getClickCount()==1) {  
			            	  music_main.Before();
			           }                
			          }public void mouseEntered(MouseEvent e) {
			        	  beforeButt.setIcon(new ImageIcon(music_view.class.getResource("/images/selectmediaBefore.png")));
			           } public void mouseExited(MouseEvent e) {
			        	   beforeButt.setIcon(new ImageIcon(music_view.class.getResource("/images/mediaBefore.png")));
			          }});
	  	
	  		  playOrPause = new JButton("");
	  		  controlButtPanel.add(playOrPause);
	  		  playOrPause.setIcon(new ImageIcon(music_view.class.getResource("/images/mediaPlay.png")));
	  		  playOrPause.setFocusPainted(false);
	  		  playOrPause.setBorderPainted(false);
	  		  playOrPause.setContentAreaFilled (false);
	  		  playOrPause.setToolTipText("播放");
	  		  playOrPause.addMouseListener(new MouseAdapter(){
			         public void mouseClicked(MouseEvent e) {    
			              if (e.getClickCount()==1) {  
			            		music_main.PlayOrPause();
			            		Isplay = !Isplay; 
								if(Isplay) {
									playOrPause.setToolTipText("播放");
								}else playOrPause.setToolTipText("暂停");
			           }                
			          }public void mouseEntered(MouseEvent e) {
			        	  if(Isplay) {
			        		  playOrPause.setIcon(new ImageIcon(music_view.class.getResource("/images/selectmediaPlay.png")));
			        	  }else playOrPause.setIcon(new ImageIcon(music_view.class.getResource("/images/selectmediaPause.png")));

			           } public void mouseExited(MouseEvent e) {
			        	  if(Isplay) {
			        		  playOrPause.setIcon(new ImageIcon(music_view.class.getResource("/images/mediaPlay.png")));
			        	  }else playOrPause.setIcon(new ImageIcon(music_view.class.getResource("/images/mediaPause.png")));
			          }});
	  		 
	  		  nextButt = new JButton(""); 
	  		  controlButtPanel.add(nextButt);
	  		  nextButt.setFocusPainted(false);
	  		  nextButt.setBorderPainted(false);
	  		  nextButt.setContentAreaFilled(false);
	  		  nextButt.setIcon(new ImageIcon(music_view.class.getResource("/images/mediaNext.png")));
	  		  nextButt.setToolTipText("下一集");
	  		  nextButt.addMouseListener(new MouseAdapter(){
			         public void mouseClicked(MouseEvent e) {    
			              if (e.getClickCount()==1) {  
			            	  music_main.Next();
			           }                
			          }public void mouseEntered(MouseEvent e) {
			        	  nextButt.setIcon(new ImageIcon(music_view.class.getResource("/images/selectmediaNext.png")));
			           } public void mouseExited(MouseEvent e) {
			        	   nextButt.setIcon(new ImageIcon(music_view.class.getResource("/images/mediaNext.png")));
			          }});
	  		  
	  		  //声音
	  		  voicelabel = new JLabel("");
	  		  controlButtPanel.add(voicelabel);
	  		  voicelabel.setIcon(new ImageIcon(music_view.class.getResource("/images/mediaMute.png")));
	  		  voicelabel.setToolTipText("音量");
	  		  voicelabel.addMouseListener(new MouseAdapter(){
		         public void mouseClicked(MouseEvent e) {    
		        	  if (e.getClickCount()==1) {  
		            	  if(voice) {
						  temp = slider.getValue();
						  voicelabel.setToolTipText("静音 ");
		            	  }else {
		            		voicelabel.setToolTipText("音量 ");
		            	  }
		            	  voice = !voice;
		            	  music_main.Unmute(voice,temp);
		            }                
		          }public void mouseEntered(MouseEvent e) {
		        	  if(voice) {
		        		  voicelabel.setIcon(new ImageIcon(music_view.class.getResource("/images/selectmediaMute.png")));
		        	  }else voicelabel.setIcon(new ImageIcon(music_view.class.getResource("/images/selectmediaUnmute.png")));

		           } public void mouseExited(MouseEvent e) {
		        	  if(voice) {
		        		  voicelabel.setIcon(new ImageIcon(music_view.class.getResource("/images/mediaMute.png")));
		        	  }else voicelabel.setIcon(new ImageIcon(music_view.class.getResource("/images/mediaUnmute.png")));
		          }});
	  		  
	  		  voicelabel.addMouseListener(new MouseAdapter(){
		          public void mouseClicked(MouseEvent e) {    
		            
		        }});
	  		  voicepanel = new JPanel();
	  		  controlButtPanel.add(voicepanel);
	  		  voicepanel.setLayout(new BorderLayout(0, 0));
	  		  slider = new JSlider();
	  		  voicepanel.add(slider,BorderLayout.WEST);
	  		  slider.setBackground(null);
	  		  slider.setOpaque(false);
		      slider.setPaintLabels(true);
		      slider.setSnapToTicks(true);
			  slider.setPaintTrack(true);
			  slider.setValue(100);// 设置默认音量80
			  slider.setMaximum(100);// 设置最大音量100
				slider.addChangeListener(new ChangeListener() {
					@Override
					public void stateChanged(ChangeEvent e) {
						slider.setToolTipText(String.valueOf((slider.getValue()+80)*100/86));
						
						if(slider.getValue()!=-80) {
							  voice = true;
							  voicelabel.setToolTipText("音量 ");
						}else  {
							voice = false;
							voicelabel.setToolTipText("静音 ");
						}
						float vul = slider.getValue();
								if(vul ==100) {
									vul=(float) 6;
								}
						music_main.setVol(vul);
					}
				});
			
			  voiceaccout1label = new JLabel("1");
			  voicepanel.add(voiceaccout1label,BorderLayout.CENTER);
			  voiceaccout1label.setForeground(Color.WHITE);
			  voiceaccout2label = new JLabel("00");
			  voicepanel.add(voiceaccout2label,BorderLayout.EAST);
			  voiceaccout2label.setForeground(Color.WHITE);
			  voicepanel.setBackground(null);
			  voicepanel.setOpaque(false);
			  controlButtPanel.add(empty);
			  empty.setFocusPainted(false);
			  empty.setBorderPainted(false);
			  empty.setContentAreaFilled(false);
			  String[] v={"顺序播放","随机播放","单曲循环","列表循环","单曲播放"};
			  jBox = new JComboBox(v);
			  controlButtPanel.add(jBox);
			  jBox.addActionListener(new ActionListener() {
		  			@Override
					public void actionPerformed(ActionEvent e){   	
			            	  music_main.playerloop();                
			          }});
}
	
	
	public JLabel getBigorsmall() {
		// TODO 自动生成的方法存根
		return bigorsmall;
	}
	public static JTable getTable() {
		return table;
	}


	public static  JComboBox getJBox() {
		// TODO 自动生成的方法存根
		return jBox;
	}
	
	public static  JSlider getSlider() {
		// TODO 自动生成的方法存根
		return slider;
	}
	
	public static JProgressBar getProgress() {
		// TODO 自动生成的方法存根
		return progress;
	}
	public static boolean getIsplay() {
		// TODO 自动生成的方法存根
		return Isplay;
	}


	public JLabel getVoiceaccout1label() {
		// TODO 自动生成的方法存根
		return voiceaccout1label;
	}


	public JLabel getVoiceaccout2label() {
		// TODO 自动生成的方法存根
		return voiceaccout2label;
	}


	public JLabel getVoicelabel() {
		// TODO 自动生成的方法存根
		return voicelabel;
	}
	public static JLabel getCurrentLabel() {
		// TODO 自动生成的方法存根
		return currtimepanel;
	}
	public static JLabel getTotalLabel() {
		return totaltimepanel;
	}
	public static JLabel getTextLyrics0() {
		return textLyric0;
	}
	public static JLabel getTextLyrics1() {
		return textLyric1;
	}
	public static JLabel getTextLyrics2() {
		return textLyric2;
	}
	public static JLabel getTextLyrics3() {
		return textLyric3;
	}
	public static JLabel getTextLyrics4() {
		return textLyric4;
	}
	public static JLabel getTextLyrics5() {
		return textLyric5;
	}
	public static JLabel getTextLyrics6() {
		return textLyric6;
	}
	public static JLabel getSongN() {
		return songN;
	}
	public static JButton getPlayOrPause() {
		return playOrPause;
	}
	public static JLabel getUpsongshow() {
		return upsongshow;
	}

}
